
package com.cbwl.eoas.cms.model.sysconfig;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
import org.springframework.util.StringUtils;

import com.cbwl.eoas.common.base.CommonBean;
import com.cbwl.eoas.common.cache.redis.RedisCache;
import com.cbwl.eoas.common.cache.redis.RedisKeyPrefix;
import com.cbwl.eoas.common.util.SpringContextUtil;

/**
 * 
 * <p>[描述信息：说明类的基本功能]</p>
 *
 * @author 虞云波 - yuyunbo@3856.cc
 * @version 1.0 Created on 2017年10月20日 下午5:24:35
 */
public class SysPositionDTO extends CommonBean {

	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -3993907747242487403L;
	private java.lang.Long id;
	@NotBlank @Length(max=32)
	private java.lang.String posCode;
	
	private java.lang.String posName;
	private Integer pid;
	
	private String posDescrible;
	private java.lang.String posResponsibility;
	
	private String posStatus;
	
	private java.lang.Long creater;
	
	private java.util.Date gmtCreate;
	
	private java.lang.Long modifier;
	
	private java.util.Date gmtModified;
	//columns END
	
	private String posStatusName;

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("PosCode",getPosCode())
			.append("PosName",getPosName())
			.append("Pid",getPid())
			.append("PosDescrible",getPosDescrible())
			.append("PosResponsibility",getPosResponsibility())
			.append("PosStatus",getPosStatus())
			.append("Creater",getCreater())
			.append("GmtCreate",getGmtCreate())
			.append("Modifier",getModifier())
			.append("GmtModified",getGmtModified())
			.toString();
	}
	
	
	public java.lang.Long getId() {
		return id;
	}

	
	public void setId(java.lang.Long id) {
		this.id = id;
	}

	
	public java.lang.String getPosCode() {
		return posCode;
	}

	
	public void setPosCode(java.lang.String posCode) {
		this.posCode = posCode;
	}

	
	public java.lang.String getPosName() {
		return posName;
	}

	
	public void setPosName(java.lang.String posName) {
		this.posName = posName;
	}

	
	public Integer getPid() {
		return pid;
	}

	
	public void setPid(Integer pid) {
		this.pid = pid;
	}

	
	public String getPosDescrible() {
		return posDescrible;
	}

	
	public void setPosDescrible(String posDescrible) {
		this.posDescrible = posDescrible;
	}

	
	public java.lang.String getPosResponsibility() {
		return posResponsibility;
	}

	
	public void setPosResponsibility(java.lang.String posResponsibility) {
		this.posResponsibility = posResponsibility;
	}

	
	public String getPosStatus() {
		return posStatus;
	}

	
	public void setPosStatus(String posStatus) {
		this.posStatus = posStatus;
		if (!StringUtils.isEmpty(posStatus)) {
			RedisCache<String, String> redisCache = (RedisCache<String, String>) SpringContextUtil.getBean("redisCache");
			String redisValue =  redisCache.getStr(RedisKeyPrefix.DIC_PREFIX+posStatus);
			if (!StringUtils.isEmpty(redisValue)) {
				this.posStatusName = redisValue;
			}
		}
	}

	
	public java.lang.Long getCreater() {
		return creater;
	}

	
	public void setCreater(java.lang.Long creater) {
		this.creater = creater;
	}

	
	public java.util.Date getGmtCreate() {
		return gmtCreate;
	}

	
	public void setGmtCreate(java.util.Date gmtCreate) {
		this.gmtCreate = gmtCreate;
	}

	
	public java.lang.Long getModifier() {
		return modifier;
	}

	
	public void setModifier(java.lang.Long modifier) {
		this.modifier = modifier;
	}

	
	public java.util.Date getGmtModified() {
		return gmtModified;
	}

	
	public void setGmtModified(java.util.Date gmtModified) {
		this.gmtModified = gmtModified;
	}
	
	public String getPosStatusName() {
		return posStatusName;
	}


	
	public void setPosStatusName(String posStatusName) {
		this.posStatusName = posStatusName;
	}


	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof SysPositionDTO == false){return false;}
		if(this == obj){return true;}
		SysPositionDTO other = (SysPositionDTO)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

